from driver import GPIO

channel_1 = GPIO()
channel_2 = GPIO()
channel_3 = GPIO()
channel_4 = GPIO()
channel_5 = GPIO()
channel_6 = GPIO()
channel_7 = GPIO()
channel_8 = GPIO()
channel_9 = GPIO()
channel_0 = GPIO()


channel_1.open("io1")
channel_2.open("io2")
channel_3.open("io3")
channel_4.open("io4")
channel_5.open("io5")
channel_6.open("io6")
channel_7.open("io7")
channel_8.open("io8")
channel_9.open("io9")
channel_0.open("io0")




def channel_on(channel_name):  
    if channel_name == "channel_1":
        channel_object = channel_1
    elif channel_name == "channel_2":
        channel_object = channel_2
    elif channel_name == "channel_3":
        channel_object = channel_3
    elif channel_name == "channel_4":
        channel_object = channel_4
    elif channel_name == "channel_5":
        channel_object = channel_5
    elif channel_name == "channel_6":
        channel_object = channel_6
    elif channel_name == "channel_7":
        channel_object = channel_7
    elif channel_name == "channel_8":
        channel_object = channel_8
    elif channel_name == "channel_9":
        channel_object = channel_9
    elif channel_name == "channel_0":
        channel_object = channel_0
    channel_object.write(1)

def channel_off(channel_name):
    if channel_name == "channel_1":
        channel_object = channel_1
    elif channel_name == "channel_2":
        channel_object = channel_2
    elif channel_name == "channel_3":
        channel_object = channel_3
    elif channel_name == "channel_4":
        channel_object = channel_4
    elif channel_name == "channel_5":
        channel_object = channel_5
    elif channel_name == "channel_6":
        channel_object = channel_6
    elif channel_name == "channel_7":
        channel_object = channel_7
    elif channel_name == "channel_8":
        channel_object = channel_8
    elif channel_name == "channel_9":
        channel_object = channel_9
    elif channel_name == "channel_0":
        channel_object = channel_0
    channel_object.write(0)

   
